@section('title', '用户列表')
@section('header')
    <div class="layui-inline">
        <button class="layui-btn layui-btn-small layui-btn-normal addBtn" data-desc="添加用户" data-url="{{url('/content/0/edit')}}"><i class="layui-icon">&#xe654;</i></button>
        <button class="layui-btn layui-btn-small layui-btn-warm freshBtn"><i class="layui-icon">&#x1002;</i></button>
    </div>

    <div class="layui-inline">
        <input type="text" lay-verify="title" value="{{ $input['agency_name'] or '' }}" name="agency_name" placeholder="请输入旅行社名字" autocomplete="off" class="layui-input">
    </div>
    <div class="layui-inline">
        <input type="text" lay-verify="title" value="{{ $input['user_name'] or '' }}" name="user_name" placeholder="请输入负责人名字" autocomplete="off" class="layui-input">

    </div>
    <div class="layui-inline">
        <input class="layui-input" name="addtime" placeholder="开始日期" onclick="layui.laydate({elem: this, festival: true})" value="{{ $input['begin'] or '' }}">
    </div>
    <div class="layui-inline">
        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">搜索</button>
    </div>
@endsection

@section('table')
    <table class="layui-table" lay-even lay-skin="nob">
        <colgroup>
            <col class="hidden-xs" width="50">
            <col class="hidden-xs" width="200">
            <col class="hidden-xs" width="150">
            <col>
            <col class="hidden-xs" width="150">
            <col width="200">
        </colgroup>
        <thead>
        <tr>
            <th class="hidden-xs">ID</th>
            <th class="hidden-xs">标题</th>
            <th class="hidden-xs">栏目</th>
            <th class="hidden-xs">售价</th>
            <th class="hidden-xs">佣金</th>
            <th class="hidden-xs">图片</th>
            <th class="hidden-xs">起止时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($lists as $info)
            <tr>
                <td class="hidden-xs">{{$info->id}}</td>
                <td class="hidden-xs">{{$info->title}}</td>
                <td class="hidden-xs">{{$info->name}}</td>
                <td class="hidden-xs">{{$info->price}}</td>
                <td class="hidden-xs">{{$info->commission}}</td>
                <td class="hidden-xs"><img src="{{$info->img}}" width="50px" height="50px"   /></td>
                <td class="hidden-xs">{{$info->setime}}</td>

                <td>
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-small layui-btn-normal edit-btn" data-id="{{$info->id}}" data-desc="修改用户" data-url="{{url('/content/'. $info->id .'/edit')}}"><i class="layui-icon">&#xe642;</i></button>
                        <button class="layui-btn layui-btn-small layui-btn-danger del-btn" data-id="{{$info->id}}" data-url="{{url('/content/'.$info->id)}}"><i class="layui-icon">&#xe640;</i></button>
                    </div>
                </td>
            </tr>
            @if(!$lists[0])
                <tr><td colspan="6" style="text-align: center;color: orangered;">暂无数据</td></tr>
            @endif
        @endforeach
        </tbody>
    </table>
    <div class="page-wrap">
        {{$lists->render()}}
    </div>
@endsection
@section('js')
    <script>
        layui.use(['form', 'jquery','laydate', 'layer'], function() {
            var form = layui.form(),
                $ = layui.jquery,
                laydate = layui.laydate,
                layer = layui.layer
            ;
            laydate({istoday: true});
            form.render();
            form.on('submit(formDemo)', function(data) {
                console.log(data);
            });
        });
    </script>
@endsection
@extends('common.list')